#ifndef CGRAPHICSVIEW_H
#define CGRAPHICSVIEW_H

#include <QGraphicsView>


QT_BEGIN_NAMESPACE
class QMouseEvent;
class QXmlStreamReader;
class CGraphicsItemGroup;
QT_END_NAMESPACE

#include "xrulebar.h"

class XGraphicsView : public QGraphicsView {
    Q_OBJECT
public:
    XGraphicsView(QWidget* parent = nullptr);

    void zoomIn();
    void zoomOut();
    void setRuleBarVisible(bool visible);

signals:
    void positionChanged(int x, int y);

protected:
    void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;
    void mouseMoveEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
    void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE;
    void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;

private:
    void updateRuler();

    XRuleBar *m_hruler;
    XRuleBar *m_vruler;
};

#endif // CGRAPHICSVIEW_H
